From 9e8a7d628a46bf3f15760cbc3d9051e44cf79d0a Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 23 Dec 2008 23:19:14 +0000 Subject: [PATCH] Follow-up to r44987 -- use the Title-filtered version for the rest of our filename processing just to be sure everything's cool. :) --- includes/specials/SpecialUpload.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index ee0153e3d4..450c8728a1 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -400,16 +400,19 @@ class UploadForm { } $filtered = wfStripIllegalFilenameChars( $basename ); + /* Normalize to title form before we do any further processing */ $nt = Title::makeTitleSafe( NS_FILE, $filtered ); if( is_null( $nt ) ) { $resultDetails = array( 'filtered' => $filtered ); return self::ILLEGAL_FILENAME; } + $filtered = $nt->getDBkey(); + /** * We'll want to blacklist against *any* 'extension', and use * only the final one for the whitelist. */ - list( $partname, $ext ) = $this->splitExtensions( $nt->getDBkey() ); + list( $partname, $ext ) = $this->splitExtensions( $filtered ); if( count( $ext ) ) { $finalExt = $ext[count( $ext ) - 1]; -- 2.20.1